<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
    String path = request.getContextPath();
    if (path.length() > 0) path = path.substring(0, path.length() - 1);
%>
<jsp:include flush="true" page="/view/inc/incTop.jsp"/>
<!-- head-->
<script type="text/javascript">
    function orderDel(orderId) {
        if (confirm("确认取消订单吗?")) {
            var url = "<%=path %>/order/orderDel.action?orderId=" + orderId;
            window.location.href = url;
        }
    }

    function orderDetail(orderId) {
        var url = "<%=path %>/order/orderDetail.action?orderId=" + orderId;
        window.frames.more.src = url;
        $('#moreInfo').modal();
    }
</script>
<!-- 拟态框 -->
<div class="modal fade" id="moreInfo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
                        class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel">详细信息</h4>
            </div>
            <div class="modal-body">
                <iframe id="more" width="100%" height="400px"></iframe>
            </div>
            <div class="modal-footer">
                <button type="button" data-dismiss="modal" class="btn" style="background:#4a9bd6;color: #fff;">关闭
                </button>
            </div>
        </div>
    </div>
</div>
<!-- 拟态框 -->
<div class="container well" style="background:#fff;padding-top:0px;padding-bottom:0px;">
    <h2>订单</h2>
    <div class="row" style="margin-left:-19px;margin-right:-19px;">
        <hr style="margin-top:0">
        <table class="table table-striped table-hover">
            <tr align="center" style="background:#4a9bd6;color: #fff;">
                <td>订单编号</td>
                <td>金额</td>
                <td>下单日期</td>
                <td>订单状态</td>
                <td>操作</td>
            </tr>
            <s:iterator value="#request.orderList" var="order">
                <tr align='center' valign="middle">
                    <td>
                        <s:property value="#order.orderNumber"/>
                    </td>
                    <td>￥
                        <s:property value="#order.orderPrice"/><br/></td>
                    <td>
                        <s:property value="#order.orderDate"/>
                    </td>
                    <td>
                        <s:if test="#order.orderState==0">
                            已下单，未受理
                        </s:if>
                        <s:if test="#order.orderState==1">
                            已下单，已受理
                        </s:if>
                        <s:if test="#order.orderState==2">
                            已完成
                        </s:if>
                        <s:if test="#order.orderState==3">
                            已取消
                        </s:if>
                    </td>
                    <td>
                        <a href="#" class="btn btn-default" onclick="orderDetail(${order.orderId})">订单明细</a>
                        <s:if test="#order.orderState==0">
                            <a href="#" class="btn btn-danger" onclick="orderDel(${order.orderId})">取消</a>
                        </s:if>
                    </td>
                </tr>
            </s:iterator>
        </table>
        <jsp:include page="/common/page.jsp" flush="true"/>
    </div>
</div>
<!--foot -->
<jsp:include flush="true" page="/view/inc/incFoot.jsp"/>
<!--foot -->	
